package Day6;
import java.util.ArrayList;
public class Demo01ArrayList {
    public static void main(String[]arge)
    {
        ArrayList<String> list=new ArrayList();//String类
        list.add("张三");//添加
        list.add("李四");
        list.add("王五");
        System.out.println(list);
        System.out.println(list.size());

        //常用方法
        //public E get(int index)从集合中获取元素
        //E remove(int index)删除元素
        //int size  获取大小
        //boolen add(E e)添加元素
        System.out.println(list.get(1));
        list.remove(2);
        System.out.println(list);
        System.out.println(list.size());
    }
}
